{extend name="web/public/base" /}
{block name="header"}
{/block}
{block name="main"}
<section class="scrollable padder">
    <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
        <li><a><i class="fa fa-home"></i> 首页</a></li>
        <li class="active">购物商城</li>
        <li class="active">{$title}</li>
    </ul>
    <div class="row">
        <div class="col-sm-12">
            <section class="panel panel-default">
                <header class="panel-heading"> --{$title}--</header>
                <div class="table-responsive">
                    <table class="table table-striped table-hover b-t b-light text-sm">
                        <thead>
                        <tr style="cursor:pointer;">
                            <th>支付时间</th>
                            <th>会员编号</th>
                            <th>订单编号</th>
                            <th>支付方式</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>{$info.pay_time|date="Y-m-d H:i:s",###}</td>
                            <td>{$info.uid|getInfo="usernumber",###}[{$info.uid|getInfo="realname",###}]</td>
                            <td>{$info.orderid}</td>
                            <td>
                                {$Think.const.HASACTIVE}
                                <!--{eq name="info.paytype" value="2"}{$Think.const.HASACTIVE}{/eq}-->
                            </td>
                            <td>
                                {eq name="info.status" value="1"}待发货{/eq}
                                {eq name="info.status" value="10"}待确认{/eq}
                                {eq name="info.status" value="20"}已完成{/eq}
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div style="margin-left: 15px;margin-top: 10px;">订单说明：{$info.message}</div>
                </div>
                <div style="height:20px;"></div>
                <header class="panel-heading"> --产品详情--</header>
                <div class="table-responsive">
                    <table class="table table-striped table-hover b-t b-light text-sm">
                        <thead>
                        <tr style="cursor:pointer;">
                            <th>商品名称</th>
                            <th>价格</th>
                            <th>数量</th>
                            <th>总计</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>{$list.goodname}</td>
                            <td>{$list.price}</td>
                            <td>{$list.num}</td>
                            <td>{$list.total}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <!--<div style="height:20px;"></div>-->
                <!--<header class="panel-heading"> &#45;&#45;备注&#45;&#45;</header>-->
                <!--<div class="table-responsive">-->
                <!--<div class="row col-lg-12">-->
                <!--{notempty name="info.info"}-->
                <!--<input type="text" class="form-control" value="{$info.info}" readonly>-->
                <!--{else/}-->
                <!--<input type="text" id="info" name="info" class="form-control" placeholder="备注"-->
                <!--value="{$info.info}">-->
                <!--{/notempty}-->
                <!--</div>-->
                <!--</div>-->

                <div style="height:20px;"></div>
                <header class="panel-heading"> --收货信息--</header>
                <div class="table-responsive">
                    <table class="table table-striped table-hover b-t b-light text-sm">
                        <thead>
                        <tr style="cursor:pointer;">
                            <th>收货人</th>
                            <th>联系方式</th>
                            <th>收货地址</th>
                            <th>下单时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>{$address.realname}</td>
                            <td>{$address.mobile}</td>
                            <td>{$address.address}</td>
                            <td>{$info.create_time|date='Y-m-d H:i:s',###}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div style="height:20px;"></div>
                <header class="panel-heading"> --快递详情--</header>
                <div class="table-responsive">
                    {eq name="info.status" value="1"}
                    <form id="ajaxform" action="{:url('send')}" method="post" onsubmit="return false;">
                        <div class="row col-lg-12">
                            <div class="form-group col-sm-4">
                                <label>快递公司</label>
                                <input type="text" id="tool" name="tool" class="form-control" placeholder="快递公司"
                                       value="">
                            </div>
                            <div class="form-group col-sm-4">
                                <label>快递单号</label>
                                <input type="text" id="toolid" name="toolid" class="form-control" placeholder="快递单号"
                                       value="">
                            </div>
                            <div class="form-group col-sm-4">
                                <label>发货人</label>
                                <input type="text" id="send_name" name="send_name" class="form-control"
                                       placeholder="发货人"
                                       value="">
                            </div>
                        </div>
                        <div class="row col-lg-12">
                            <div class="form-group col-sm-4">
                                <label>发货人联系方式</label>
                                <input type="text" id="send_contact" name="send_contact" class="form-control"
                                       placeholder="发货人联系方式"
                                       value="">
                            </div>
                            <div class="form-group col-sm-4">
                                <label>发货地址</label>
                                <input type="text" id="send_address" name="send_address" class="form-control"
                                       placeholder="发货地址"
                                       value="">
                            </div>

                        </div>
                        <footer class="panel-footer text-right bg-light lter col-sm-10">
                            <input type="hidden" name="id" value="{$list.id}">
                            <button type="submit" class="btn btn-success btn-s-xs">发货</button>
                        </footer>
                    </form>
                    {else/}
                    <table class="table table-striped table-hover b-t b-light text-sm">
                        <thead>
                        <tr style="cursor:pointer;">
                            <th>快递公司</th>
                            <th>快递单号</th>
                            <th>发货人</th>
                            <th>发货人联系方式</th>
                            <th>发货地址</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>{$list.tool}</td>
                            <td>{$list.toolid}</td>
                            <td>{$list.send_name}</td>
                            <td>{$list.send_contact}</td>
                            <td>{$list.send_address}</td>
                        </tr>
                        </tbody>
                    </table>
                    {/eq}
                </div>
            </section>
        </div>
    </div>
</section>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        $.validator.setDefaults({
            submitHandler: function () {
                ajaxSubmit();
            },
            highlight: function (element, errorClass) {
                $(element).css('border', '2px solid red');
            },
            unhighlight: function (element, errorClass) {
                $(element).css('border', '1px solid green');
            }
        });

        $('#ajaxform').validate();
    })

    $('#info').blur(function () {
        var info = $(this).val();
        var id = "{$info.id}";
        $.post("{:url('changeInfo')}", {info: info, id: id}, function (data) {
            layer.msg(data.msg);
            if (data.code) {
                setTimeout(function () {
                    location.reload();
                }, 1000)
            }
        }, 'json');
    })
</script>
{/block}
{block name="footer"}
{/block}